package com.tanhua.dubbo.server.api;

import com.tanhua.dubbo.server.enums.CommentType;
import com.tanhua.dubbo.server.pojo.Comment;
import com.tanhua.dubbo.server.pojo.Publish;
import com.tanhua.dubbo.server.vo.CommentVo;
import com.tanhua.dubbo.server.vo.PageInfo;

import java.util.List;

//好友查询
public interface SelectFriends {

    //查询好友动态
    PageInfo<Publish> selectFriends(Long userID, int page, int pageSize);

    //发布好友动态
    String insertDynamic(Publish publish);

    //查询推荐动态
    PageInfo<Publish> selectRecommend(Long userID, int page, int pageSize);

    //根据动态的ID查询数据
    Publish selectID(String ID);

    /**
     * 根据用户ID和publishId进行点赞或喜欢
     *
     * @param userId
     * @param publishId
     * @return 返回是否点赞成功
     */
    Boolean likeLoveComment(Long userId, String publishId, CommentType commentType, String text);

    /**
     * 根据用户ID和publishId进行取消点赞或喜欢
     *
     * @param userId
     * @param publishId
     * @return
     */
    Boolean disLikeComment(Long userId, String publishId, CommentType commentType, String text);

    /**
     * 查询点赞数或喜欢数,或评论数
     *
     * @param publishId
     * @return
     */
    Long queryLikeCount(String publishId, CommentType commentType);

    /**
     * 查询用户是否点赞该动态
     *
     * @param userId
     * @param publishId
     * @return
     */
    Boolean getWhetherItIsTrue(String publishId, Long userId, CommentType commentType);

    /**
     * 查询评论
     *
     * @param publishId
     * @param page
     * @param pagesize
     * @param comment
     * @return
     */
    List<Comment> selectComments(String publishId, Integer page, Integer pagesize, CommentType comment);

    /**
     * 添加评论到Comments表中
     * @param userId
     * @param publishId
     * @param commentType
     * @param text
     * @param type
     * @return
     */
    Boolean setComment(Long userId, String publishId, CommentType commentType, String text, Integer type);
}
